/*
 * LED.h
 * 
 */


#ifndef LED_H
#define LED_H

#include <stdio.h>
#include <wiringPi.h>

using namespace std;

class LED{
	char led;
	bool state;
	public:
	LED(char pin)
	:led(pin),state(false)
	{
		wiringPiSetup();
		pinMode(led,OUTPUT);
		digitalWrite(led,0);
	}
	
	void on(void)
	{
		if(state==false)
		{
			digitalWrite(led,1);
			state = true;
		}
	}
	
	void off(void)
	{
		if(state==true)
		{
			digitalWrite(led,0);
			state = false;
		}
	}
	
	bool getState(void)
	{
		return this->state;
	}
};

#endif
